<template>
  <div class="app-container">
    <iframe :src="src" style="width:100%;height:calc(100vh - 90px)"/>
  </div>
</template>

<script>
import {getToken} from "@/utils/auth";

export default {
  name: 'index',
  data() {
    return {
      src: process.env.VUE_APP_BASE_API + '/magic/web/index.html'
    }
  },
  mounted() {
    window.MAGIC_EDITOR_CONFIG = {
      title: "快速接口开发",
      header: {
        skin: true,    // 屏蔽皮肤按钮
        document: false,    // 屏蔽文档按钮
        repo: false,    // 屏蔽gitee和github
        qqGroup: false  // 屏蔽加入QQ群
      },
      request: {
        beforeSend: (config) => {
          config.headers.Authorization = 'Bearer ' + getToken()
          return config
        }
      },
      getMagicTokenValue: function(){
        return getToken();
      }
    }
  }
}
</script>

<style scoped>

* {
  margin: 0;
  padding: 0;
}

</style>
